/*
 * GLUtils.cpp
 *
 *  Created on: 02-01-2011
 *      Author: Przemek
 */

#include "utils/GLUtils.hpp"
#include "pch.hpp"

void GLUtils::drawRectangle(const Vector& position, const Dimension& size)
{
	const float x = position.getX();
	const float y = position.getY();
	const float width = size.getWidth();
	const float height = size.getHeight();

	glRectf(x, y, x + width, y + height);
}

void GLUtils::drawRectangle(const geometry::Rectangle& rectangle)
{
	drawRectangle(rectangle.getPosition(), rectangle.getSize());
}

void GLUtils::pushVerticesInQuad(const Vector& position, const Dimension& size)
{
	const float x = position.getX();
	const float y = position.getY();
	const float width = size.getWidth();
	const float height = size.getHeight();

	glVertex2f(x, y);
	glVertex2f(x + width, y);
	glVertex2f(x + width, y + height);
	glVertex2f(x, y + width);
}
